package com.pai.dao.Department;

import com.pai.entity.Department;

import java.sql.Connection;
import java.util.List;

public interface DepartmentDao {
    /**
     * 获取列表
     * @param connection
     * @return
     * @throws Exception
     */
    public List<Department> getList(Connection connection) throws Exception;



    /**
     * 根据部门类型获取部门列表
     * @param connection
     * @param depType  部门类型
     * @return
     * @throws Exception
     */
    public List<Department> getList(Connection connection, String depType) throws Exception;



    /**
     * 获取班级部门列表
     * @param connection
     * @param depId 父级部门id
     * @return
     * @throws Exception
     */
    public List<Department> getDepClassList(Connection connection, String depId) throws Exception;

    /**
     * 根据负责人id获取部门信息
     * @param connection
     * @param principalId  负责人Id
     * @return
     * @throws Exception
     */
    public List<Department> getListByPrincipalId(Connection connection, String principalId) throws Exception;

    /**
     * 获取项详情
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public Department getItemDetail(Connection connection, String id) throws Exception;


    /**
     * 获取项
     * @param connection
     * @param depName  部门名称
     * @param depType  部门类型
     * @return
     * @throws Exception
     */
    public Department getItemDetail(Connection connection, String depName, String depType) throws Exception;

    /**
     * 新增
     * @param connection
     * @param item
     * @return
     * @throws Exception
     */
    public int add(Connection connection, Department item) throws Exception;




    /**
     * 更新
     * @param connection
     * @param item
     * @return
     * @throws Exception
     */
    public int update(Connection connection, Department item) throws Exception;

    /**
     * 删除
     * @param connection
     * @param id
     * @return
     * @throws Exception
     */
    public int delete(Connection connection, String id) throws Exception;
}
